//
//  LawAccountCell.m
//  云律司
//
//  Created by 韦淋 on 2017/8/4.
//  Copyright © 2017年 test. All rights reserved.
//

#import "LawAccountCell.h"

@implementation LawAccountCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initalizeInterface];
    }
    return self;
}
- (void)initalizeInterface{
    [self.contentView addSubview:self.bgView];
    [self.bgView addSubview:self.lineView];
    [self.bgView addSubview:self.orderNumLable];
    [self.bgView addSubview:self.caseNumLable];
    [self.bgView addSubview:self.chargeAmount];
    [self.bgView addSubview:self.costType];
    [self.bgView addSubview:self.paymentDate];
    [self.bgView addSubview:self.paymentName];
    [self.bgView addSubview:self.remark];
}
- (void)layoutSubviews{
    
    
    self.bgView.frame = CGRectMake(5, 0, self.contentView.bounds.size.width - 10, self.contentView.bounds.size.height - 15);
    self.lineView.frame = CGRectMake(0, 0, self.bgView.bounds.size.width , 2);
    self.orderNumLable.frame = CGRectMake(40, 0, 350, 30);
    self.caseNumLable.frame = CGRectMake(40, 30, 350, 30);
    self.chargeAmount.frame = CGRectMake(40, 60, 350, 30);
    self.costType.frame = CGRectMake(40, 90, 350, 30);
    self.paymentDate.frame = CGRectMake(40, 120, 350, 30);
    self.paymentName.frame = CGRectMake(40, 150, 350, 30);
    self.remark.frame = CGRectMake(40, 180, 350, 30);
    for (int i = 0; i < 7; i ++) {
        UIView *dividerView = [[UIView alloc] initWithFrame:CGRectMake(0, i * 30, self.bgView.bounds.size.width , 0.5)];
        dividerView.backgroundColor = [UIColor colorWithRed:238.0f/255.0f green:238.0f/255.0f blue:238.0f/255.0f alpha:1.0f];
        [self.bgView addSubview:dividerView];
        
        NSArray *array = [NSArray array];
        array = @[@"bann_02",@"bann_03",@"bann_04",@"bann_05",@"bann_05",@"bann_05",@"bann_05",@"bann_05"];
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5 + i * 30, 20, 20)];
        //        imageView.backgroundColor = [UIColor redColor];
        imageView.image = [UIImage imageNamed:array[i]];
        
        [self.bgView addSubview:imageView];
    }
    
    
}

- (UIView *)bgView{
    if (!_bgView) {
        _bgView = [[UIView alloc] init];
        _bgView.backgroundColor = [UIColor colorWithRed:248.0f/255.0f green:248.0f/255.0f blue:248.0f/255.0f alpha:1.0f];
        //        _bgView.layer.cornerRadius=10;
        _bgView.layer.shadowColor=[UIColor lightGrayColor].CGColor;
        _bgView.layer.shadowOffset=CGSizeMake(3, 3);
        _bgView.layer.shadowOpacity=0.5;
        //        _bgView.layer.shadowRadius=5;
        //        CGPathRef path = [UIBezierPath bezierPathWithRect:CGRectMake(0, self.bounds.size.height, [UIScreen mainScreen].bounds.size.width,2)].CGPath;
        //        [_bgView setShadowPath:path];
    }
    return _bgView;
}
- (UIView *)lineView{
    if (!_lineView) {
        _lineView = [[UIView alloc] init];
        _lineView.backgroundColor = [UIColor colorWithRed:63.0f/255.0f green:189.0f/255.0f blue:240.0f/255.0f alpha:1.0f];
    }
    return _lineView;
}
- (UILabel *)orderNumLable{
    if (!_orderNumLable) {
        _orderNumLable = [[UILabel alloc]init];
        _orderNumLable.textColor = [UIColor blackColor];
        _orderNumLable.font = [UIFont systemFontOfSize:11];
    }
    return _orderNumLable;
}
- (UILabel *)caseNumLable{
    if (!_caseNumLable) {
        _caseNumLable = [[UILabel alloc]init];
        _caseNumLable.textColor = [UIColor blackColor];
        _caseNumLable.font = [UIFont systemFontOfSize:11];
    }
    return _caseNumLable;
}

- (UILabel *)chargeAmount{
    if (!_chargeAmount) {
        _chargeAmount = [[UILabel alloc]init];
        _chargeAmount.textColor = [UIColor blackColor];
        _chargeAmount.font = [UIFont systemFontOfSize:11];
    }
    return _chargeAmount;
}
- (UILabel *)costType{
    if (!_costType) {
        _costType = [[UILabel alloc]init];
        _costType.textColor = [UIColor blackColor];
        _costType.font = [UIFont systemFontOfSize:11];
    }
    return _costType;
}
- (UILabel *)paymentDate{
    if (!_paymentDate) {
        _paymentDate = [[UILabel alloc]init];
        _paymentDate.textColor = [UIColor blackColor];
        _paymentDate.font = [UIFont systemFontOfSize:11];
    }
    return _paymentDate;
}
- (UILabel *)paymentName{
    if (!_paymentName) {
        _paymentName = [[UILabel alloc]init];
        _paymentName.textColor = [UIColor blackColor];
        _paymentName.font = [UIFont systemFontOfSize:11];
    }
    return _paymentName;
}
- (UILabel *)remark{
    if (!_remark) {
        _remark = [[UILabel alloc]init];
        _remark.textColor = [UIColor blackColor];
        _remark.font = [UIFont systemFontOfSize:11];
    }
    return _remark;
}
@end

